<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script src="./src/vue.js"></script>
    <style>
      .test {
        width: 100px;
        height: 100px;
        background-color: yellow;
      }
      .v-enter-active {
        animation: rotate 2s linear infinite;
      }
      .v-leave-active {
        animation: leave 2s linear infinite;
      }
      @keyframes rotate {
        0% {
          transform: rotate(0deg);
        }
        100% {
          transform: rotate(360deg);
        }
      }
      @keyframes leave {
        0% {
          transform: translateX(0);
        }
        100% {
          transform: translateX(300px);
        }
      }
    </style>
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <transition>
        <div class="test" v-show="show">111</div>
      </transition>
      <button @click="show=!show">显示/隐藏</button>
    </div>
    <script>
      const vm = new Vue({
        el: "#app",
        data: {
          show: true,
        },
      });
    </script>
  </body>
</html>
